import googlemap.GoogleStaticMapFactory;
import googlemap.LatLng;
import googlemap.MapImageI;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Connor Madden.
 * User: Connor Madden
 * Date: 31/03/12
 * Time: 11:11 PM
 */
public class Run {

    public static void main(String[] args) {
        JFrame jFrame = new JFrame();
        jFrame.setTitle("Cattle Trajectory Program Test");
        Container container = jFrame.getContentPane();
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        ImageIcon imageIcon;
        MapImageI mapImage = GoogleStaticMapFactory.newGoogleStaticMap(new LatLng(0,0), 2, 256, 256, 1,
                GoogleStaticMapFactory.Format.PNG, GoogleStaticMapFactory.MapType.SATELLITE);
        if (mapImage == null) {
            container.add(new JLabel("Cannot connect to Google Maps API"));
        } else {
            imageIcon = new ImageIcon(mapImage.getImage());
            container.add(new JLabel(imageIcon));
        }
        jFrame.pack();
        jFrame.setVisible(true);
        
        Point p =  mapImage.fromLatLngToPoint(new LatLng(0, 0));
        
        System.out.println(p.x + "," + p.y);
    }
}
